﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RastinArgham.CRM.Business
{
    public partial class StockItem
    {
        public String ProductName
        {
            get { return this.Product.ProductName; }
        }

        public String StatusDescription
        {
            get { return this.StockItemState.Description; }
        }

        public String AgentName
        {
            get
            {
                if (this.AssignedTo.HasValue)
                    return this.aspnet_Users.UserName;
                else
                    return String.Empty;

            }
        }

        public String OwnerName
        {
            get
            {
                if (this.OrderId.HasValue)
                    return this.Order.Contact.ContactTitle;
                else
                    return String.Empty;
            }
        }

        public int OwnerContactId
        {
            get
            {
                if (this.OrderId.HasValue)
                    return this.Order.ContactId;
                else
                    return -1;
            }
        }
    }
}
